Remove current workflow state if its done#9195
Conversation
|
As discussed in #9191 (comment), I don't think we can use id because they aren't unique. Re-asking here: @agrare One more question. When the entire flow is done, does the "current" state have a "finished time"? If so, that might be the simplest check. |
Yes, |
|
@GilbertCherrie So, I think the path forward, is when you check for the presence of State, simply also check that FinishedTime is not present. |
| if (rows.length > 0) { | ||
| lastId = rows[rows.length - 1].id; | ||
| } | ||
| if (response.context && response.context.State) { |
There was a problem hiding this comment.
So basically, something like the following (not sure this works, but you get the idea)
| if (response.context && response.context.State) { | |
| if (response.context && response.context.State && !response.context.State.FinishedTime) {) { |
There was a problem hiding this comment.
and then of course you don't need any of the other changes.
There was a problem hiding this comment.
Sounds good, made the fix and repushed
5763990 to
d70ec18
Compare
d70ec18 to
635dbcc
Compare
|
@Fryguy I made the fix to check for the FinishedTime |
|
Checked commit GilbertCherrie@635dbcc with ruby 2.7.8, rubocop 1.56.3, haml-lint 0.51.0, and yamllint |
|
Backported to |
…state Remove current workflow state if its done (cherry picked from commit ecce835)
Follow up to pr: #9191
When the current state is done its value is not removed from the context.State but also exists in the context.StateHistory. This pr prevents this state from rendering in the table as both a past state and current state and instead will only render it as a past state.
Before:

After:
